// src/api/eastjet-maintenance/type/type.js
import request from "@/utils/request2";

// 查询设备类型
export function listType() {
  return request({
    url: "/select",
    method: "get",
  });
}

export function SelectDeviceType(name) {
  return request({
    url: "/selectTypes?name=" + name,
    method: "get",
  });
}

export function listData() {
  return request({
    url: "/selectLocation",
    method: "get",
  });
}

export function selectZi(code) {
  return request({
    url: "/zidian?code=" + code,
    method: "get",
  });
}

export function selectLocation(name) {
  return request({
    url: "/selectLocation?name=" + name,
    method: "get",
  });
}

export function selectLocation2(name,pageNum,pageSize) {
  return request({
    url: "/selectLocation?name=" + name + "&pageNum=" + pageNum + "&pageSize=" + pageSize,
    method: "get",
  });
}

export function InsertLocation(location) {
  return request({
    url: "/InsertLocation",
    method: "post",
    data: location,
    header: {
      "Content-Type": "application/json", //如果写成contentType会报错
    },
  });
}

export function UpdateLocation(location) {
  return request({
    url: "/UpdateLocation",
    method: "post",
    data: location,
  });
}

export function InsertDeviceType(typer) {
  return request({
    url: "/InsertSbType",
    method: "post",
    data: typer,
    header: {
      "Content-Type": "application/json", //如果写成contentType会报错
    },
  });
}

export function UpdateDEviceType(typer) {
  return request({
    url: "/updatetypeqi",
    method: "post",
    data: typer,
    header: {
      "Content-Type": "application/json", //如果写成contentType会报错
    },
  });
}

// 查询备件类型
export function listTypekk(typePart) {
  return request({
    url: "/selectTypePat",
    method: "get",
    params: typePart,
  });
}

//新增备件类型
export function InsertTypePart(typePart) {
  return request({
    url: "/InsertTypePart",
    method: "post",
    data: JSON.stringify(typePart),
    header: {
      "Content-Type": "application/json", //如果写成contentType会报错
    },
  });
}

//修改/删除备件类型
export function UpdateTypePart(typePart) {
  return request({
    url: "/UpdateTypePart",
    method: "post",
    data: JSON.stringify(typePart),
    header: {
      "Content-Type": "application/json", //如果写成contentType会报错
    },
  });
}
